      <tr>
        <td class="label" valign="top">
          {if $var.desc}
          <a href="javascript:showNotice('notice{$var.code}');" title="{$lang.form_notice}"><img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}" /></a>
          {/if}
          {$var.name}:
        </td>
        <td class="panel-par">
          {if $var.type eq "text"}
          <input name="value[{$var.id}]" type="text" value="{$var.value}" size="40" />

          {elseif $var.type eq "password"}
          <input name="value[{$var.id}]" type="password" value="{$var.value}" size="40" />

          {elseif $var.type eq "textarea"}
          <textarea name="value[{$var.id}]" cols="40" rows="5">{$var.value}</textarea>

          {elseif $var.type eq "select"}
          {foreach from=$var.store_options key=k item=opt}
          <label for="value_{$var.id}_{$k}"><input type="radio" name="value[{$var.id}]" id="value_{$var.id}_{$k}" value="{$opt}"
            {if $var.value eq $opt}checked="true"{/if}
            {if $var.code eq 'rewrite'}
              onclick="return ReWriterConfirm(this);"
            {/if}
            {if $var.code eq 'smtp_ssl' and $opt eq 1}
              onclick="return confirm('{$lang.smtp_ssl_confirm}');"
            {/if}
            {if $var.code eq 'enable_gzip' and $opt eq 1}
              onclick="return confirm('{$lang.gzip_confirm}');"
            {/if}
            {if $var.code eq 'retain_original_img' and $opt eq 0}
              onclick="return confirm('{$lang.retain_original_confirm}');"
            {/if}
          />{$var.display_options[$k]}</label>
          {/foreach}

          {elseif $var.type eq "options"}
          <select name="value[{$var.id}]" id="value_{$var.id}_{$key}">
            {html_options options=$lang.cfg_range[$var.code] selected=$var.value}
          </select>

          {elseif $var.type eq "file"}
          <input name="{$var.code}" type="file" size="40" />
          {if ($var.code eq "shop_logo" or $var.code eq "no_picture" or $var.code eq "watermark" or $var.code eq "shop_slagon" or $var.code eq "wap_logo") and $var.value}
            <a href="?act=del&code={$var.code}"><img src="images/no.gif" alt="Delete" border="0" /></a> <img src="images/yes.gif" border="0" onmouseover="showImg('{$var.code}_layer', 'show')" onmouseout="showImg('{$var.code}_layer', 'hide')" />
            <div id="{$var.code}_layer" style="position:absolute; width:100px; height:100px; z-index:1; visibility:hidden" border="1">
              <img src="{$var.value}" border="0" />
            </div>
          {else}
            {if $var.value neq ""}
            <img src="images/yes.gif" alt="yes" />
            {else}
            <img src="images/no.gif" alt="no" />
            {/if}
          {/if}
          {elseif $var.type eq "manual"}

            {if $var.code eq "shop_country"}
              <select name="value[{$var.id}]" id="selCountries" onchange="region.changed(this, 1, 'selProvinces')">
                <option value=''>{$lang.select_please}</option>
                {foreach from=$countries item=region}
                  <option value="{$region.region_id}" {if $region.region_id eq $cfg.shop_country}selected{/if}>{$region.region_name}</option>
                {/foreach}
              </select>
                  {elseif $var.code eq "shop_province"}
              <select name="value[{$var.id}]" id="selProvinces" onchange="region.changed(this, 2, 'selCities')">
                <option value=''>{$lang.select_please}</option>
                {foreach from=$provinces item=region}
                  <option value="{$region.region_id}" {if $region.region_id eq $cfg.shop_province}selected{/if}>{$region.region_name}</option>
                {/foreach}
              </select>
            {elseif $var.code eq "shop_city"}
              <select name="value[{$var.id}]" id="selCities">
                <option value=''>{$lang.select_please}</option>
                {foreach from=$cities item=region}
                  <option value="{$region.region_id}" {if $region.region_id eq $cfg.shop_city}selected{/if}>{$region.region_name}</option>
                {/foreach}
              </select>
            {elseif $var.code eq "lang"}
                  <select name="value[{$var.id}]">
                  {html_options values=$lang_list output=$lang_list selected=$var.value}
                  </select>
            {elseif $var.code eq "invoice_type"}
            <table>
              <tr>
                <th scope="col">{$lang.invoice_type}</th>
                <th scope="col">{$lang.invoice_rate}</th>
              </tr>
              <tr>
                <td><input name="invoice_type[]" type="text" value="{$cfg.invoice_type.type[0]}" /></td>
                <td><input name="invoice_rate[]" type="text" value="{$cfg.invoice_type.rate[0]}" /></td>
              </tr>
              <tr>
                <td><input name="invoice_type[]" type="text" value="{$cfg.invoice_type.type[1]}" /></td>
                <td><input name="invoice_rate[]" type="text" value="{$cfg.invoice_type.rate[1]}" /></td>
              </tr>
              <tr>
                <td><input name="invoice_type[]" type="text" value="{$cfg.invoice_type.type[2]}" /></td>
                <td><input name="invoice_rate[]" type="text" value="{$cfg.invoice_type.rate[2]}" /></td>
              </tr>
            </table>
            {/if}
          {/if}
          {if $var.desc}
          <br />
          <span class="notice-span" {if $help_open}style="display:block" {else} style="display:none" {/if} id="notice{$var.code}">{$var.desc|nl2br}</span>
          {/if}
          {if $var.code eq 'sms_order_placed' || $var.code eq 'sms_order_payed' || $var.code eq 'sms_order_shipped' ||  $var.code eq 'sms_order_payed_to_customer' }
            <span class="act-hover cl-link" style="margin-left: 20px;cursor:pointer" onmouseenter = "actHover(this)" onmouseleave="actLeave(this)">{$lang.preview_template}</span> <span class="panel-pop"> {$demo_sms_info[$var.code]}</span>
          {/if}
        </td>
      </tr>

      <script>
        function actHover(item){
          var pop = item.nextElementSibling;
          pop.style.display = 'block';
        }
        function actLeave(item){
          var pop = item.nextElementSibling;
          pop.style.display = 'none';
        }
      </script>
